<?php Schema::init(); ?>
<div class="schema_wrapper">
	<?php if ($error != -1) { ?>
		<div class="schema_message">
		<?php if (!$error) {
			Backend::infoMessage(__('Settings updated successfully'));
		} else {
			Backend::errorMessage(__('Error updating settings'));
		} ?>
		</div>
	<?php } ?>

	<div class="schema_header">
		<?php echo __('Updating settings'); ?>
	</div>
	<form action="<?php echo CURRENT_URL, $info['id']; ?>" method="post">
		<div class="schema_tabs">
			<ul class="nav nav-pills">
				<li id="schema_tab_0" class="active">
					<a href="#0" onclick="Core.Schema.openTab(0)"><?php echo __('General'); ?></a>
				</li>
			<?php Schema::drawTabs('settings.xml'); ?>
			</ul>
		</div>
		<div class="schema_blocks">
			<div class="schema_block" id="schema_block_0">
				<?php if (empty($info)) { ?>
					<?php echo __('Information not available.'); ?>
				<?php } else { ?>
					<table class="table">
						<colgroup>
							<col class="schema_column_headers" />
							<col class="schema_column_fields" />
						</colgroup>
					<?php if (intval($info['insert_user_id']) > 0) { ?>
						<tr>
							<td class="schema_cell_header"><?php echo __('Inserted by'); ?></td>
							<td class="schema_cell_field"><?php echo User::getName($info['insert_user_id']); ?></td>
						</tr>
					<?php } ?>

					<?php if (intval($info['insert_time']) > 0) { ?>
						<tr>
							<td class="schema_cell_header"><?php echo __('Inserted at'); ?></td>
							<td class="schema_cell_field"><?php echo User::getDate(User::getId(), $info['insert_time']); ?></td>
						</tr>
					<?php } ?>

					<?php if (intval($info['update_user_id']) > 0) { ?>
						<tr>
							<td class="schema_cell_header"><?php echo __('Updated by'); ?></td>
							<td class="schema_cell_field"><?php echo User::getName($info['update_user_id']); ?></td>
						</tr>
					<?php } ?>

					<?php if (intval($info['update_time']) > 0) { ?>
						<tr>
							<td class="schema_cell_header"><?php echo __('Updated at'); ?></td>
							<td class="schema_cell_field"><?php echo User::getDate(User::getId(), $info['update_time']); ?></td>
						</tr>
					<?php } ?>

					<?php if (intval($info['delete_user_id']) > 0) { ?>
						<tr>
							<td class="schema_cell_header"><?php echo __('Deleted by'); ?></td>
							<td class="schema_cell_field"><?php echo User::getName($info['delete_user_id']); ?></td>
						</tr>
					<?php } ?>

					<?php if (intval($info['delete_time']) > 0) { ?>
						<tr>
							<td class="schema_cell_header"><?php echo __('Deleted at'); ?></td>
							<td class="schema_cell_field"><?php echo User::getDate(User::getId(), $info['delete_time']); ?></td>
						</tr>
					<?php } ?>
					</table>
				<?php } ?>
			</div>
			<?php Schema::drawBlocks('settings.xml', 'tbl_settings_fields', 'settings_id', $info['id']); ?>
		</div>
		<div class="schema_buttons"><input type="submit" value="<?php echo __('Update'); ?>" class="btn btn-primary" /></div>
	</form>
</div>